package cn.iocoder.mall.product.entities;

import cn.iocoder.common.utils.common.annotation.Dict;
import cn.iocoder.common.utils.common.system.util.Long2StringSerializer;
import cn.iocoder.common.utils.common.system.util.String2LongDeserialize;
import cn.iocoder.mall.product.dto.CommoditySkuDTO;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;

@Data
public class ProductMsg implements Serializable {

    /**条目（方便商户管理商品）*/
    private String entryId;
    /**条目名称（方便商户管理商品）*/
    private String entryName;
    private String categoryName;
    private Integer cid;
    /**状态(true上架，false下架)*/
    @Excel(name = "状态(true上架，false下架)", width = 15)
    private Boolean visible;
    /**品牌ID*/
    private String brandId;
    /**副标题*/
    @Size(min = 2,max = 100,message = "副标题大小(2-100)")
    private String caption;
    /**SPU名称*/
    @Size(min = 2,max = 100,message = "SPU名称大小(2-100)")
    private String name;
    /**SPU主键*/
    @JsonDeserialize(using = String2LongDeserialize.class)
    @JsonSerialize(using = Long2StringSerializer.class)
    private Long id;
    /**是否删除*/
    @Excel(name = "是否删除（0;未删除，1：删除）", width = 15)
    private Boolean deleted;
    /**商家ID*/
    private String sellerId;
    /**小图*/
    private String picUrls;
    @JsonDeserialize(using = String2LongDeserialize.class)
    @JsonSerialize(using = Long2StringSerializer.class)
    private Long defaultItemId;
    /**审核（0：待审核。1审核通过）*/
    @Dict(dicCode = "to_examine")
    private String toExamine;
    /**品牌*/
    @Excel(name = "品牌", width = 15)
    @NotNull(message = "品牌名称不能为空")
    @Size(min = 2,max = 100,message = "品牌名称大小不合法()")
    private String brand;
    /**所属类目名*/
    @Excel(name = "所属类目名", width = 15)
    private String category;
    /**所属类目ID，子类目*/
    @Excel(name = "所属类目ID，子类目", width = 15)
    private String categoryId;
    /**SPU_id */
    /**商品图片 */
    @Excel(name = "商品sku图片", width = 15)
    private String picUrl;
    /**市场价*/
    @Excel(name = "市场价", width = 15)
    @DecimalMin(value = "0",message = "市场价格不能小于0")
    private Integer marketPrice;
    /**库存数量*/
    @Excel(name = "库存数量", width = 15)
    @Size(message = "库存数量不能小于0 ")
    private Integer quantity;
    /**商品价格，单位：元*/
    @Excel(name = "商品价格，单位：元", width = 15)
    @DecimalMin(value = "0",message = "商品价格不能小于0")
    private Integer price;
    /**商品卖点*/
    @Excel(name = "商品卖点", width = 15)
    @Size(min = 2,max = 500,message = "商品卖点(2-500)")
    private String sellPoint;
    /**店铺_id*/
    @Excel(name = "店铺_id", width = 15)
    private String shopId;
    /**规格*/
    @Excel(name = "规格", width = 15)
    @Size(min = 2,max = 200,message = "规格字数大小(2-200) attrs")
    private String attrs;
    /**状态，1上架，2下架，3删除*/
    @Excel(name = "状态，1上架，2下架，3删除", width = 15)
    private String status;
    /**商品标题*/
    @Excel(name = "商品标题", width = 15)
    @NotNull(message = "商品标题不能为空")
    @Size(min = 2,max = 100,message = "商品标题大小不合法(2-100)")
    private String title;
    /**SKU_id*/
    private Long skuId;
    private String shopName;

    private List<CommoditySkuDTO> productSkuList;
}
